<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>选择流转的供应商</title>
    <s:head/>
</head>
<script type="text/javascript">
    var sup_type = '<s:property value="sup_type" />';
    var com_type = '<s:property value="com_type" />';
    var id = '<s:property value="id" />';
    var title = '选择<s:property value="title" />流转的供应商';
    var formSetting = {
        title: title,
        module: 'save',
        columns: [{
            name: "supChoice",
            label: "选择流转的供应商",
            type: "dropdown",
            dropdownType: "ajax",
            validate: "validate[required]",
            url: "../base/dropdown-supComByNameType?com_type=" + com_type + "&sup_type=" + sup_type + "&decidePara=supBooking",
            minLength: 0
        },
            {
                name: "id",
                value: id,
                hidden: true
            },
            {
                name: "sup_type",
                value: sup_type,
                hidden: true
            }],
        form: {
            'url': 'bizFlow-validateSaveFlow',
            'afterAjaxSuccess': function (responseText, statusText, xhr, $form) {

                if ($.parseJSON(responseText.msg).state == "1") {
                    if (sup_type == "D") {
                        window.parent.location.href = "declaration-listForSupToValidate";
                    } else if (sup_type == "C") {
                        window.parent.location.href = "booking-listForSupToValidate";
                    } else if (sup_type == "F") {
                        window.parent.location.href = "trail-listForSupToValidate";
                    }
                    jw.close();

                }
            }
        },
        buttons: {}
    };
    $(document).ready(function () {
        $("#formtable").mrdForm(formSetting);
    });
</script>
<body>
<div style="width: 100%">
    <div id="formtable">
    </div>
</div>
</body>
</html>
